<?php
include 'functions.php';
$db = include 'db.php';

p($_GET);
//组合新数据
$db[$_GET['key']] = array(
    'name' => $_GET['username'],
    'content' => $_GET['content'],
    'addtime' => time(),
);


//组合要写回去的数据
$backarr = "<?php \r\n return ".var_export($db,true)."\n\r ?>";
//将新的数据写回去
file_put_contents('db.php',$backarr);

echo '
<script>
alert(\'编辑留言成功！！！\');
location.href = \'../index.php\';
</script>
';





?>